package cn.com.gyq.crop;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;

import java.io.IOException;

import cn.com.gyq.crop.view.CropImageView;

public class MainActivity extends Activity {

    CropImageView cropImageView;
    Button button;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        cropImageView = (CropImageView) findViewById(R.id.cropImageView);
        button = (Button) findViewById(R.id.cropOk);


        Glide.with(this)
                .load(R.drawable.test)
                .asBitmap()
                .into(cropImageView);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                button.setText("Rect:" + cropImageView.getImageRect());
                Toast.makeText(MainActivity.this, "Rect:" + cropImageView.getImageRect(), Toast.LENGTH_SHORT).show();
            }
        });
    }


}
